<template>
  <div class="login-main">
    <vue-particles style="position: absolute; width: 100%; height: 100%"
        color="#dedede"
        :particleOpacity="0.7"
        :particlesNumber="80"
        shapeType="circle"
        :particleSize="4"
        linesColor="#dedede"
        :linesWidth="1"
        :lineLinked="true"
        :lineOpacity="0.4"
        :linesDistance="150"
        :moveSpeed="3"
        :hoverEffect="true"
        hoverMode="grab"
        :clickEffect="false"
        clickMode="push"
    >
    </vue-particles>
    <div class="login-form">
      <div style="margin: 0 auto; width: 65px; height: 65px">
        <img width="65px" height="65px" :src="require('@/assets/logo.png')">
      </div>
      <el-form label-position="top" label-width="80px">
        <el-form-item>
          <el-input v-model="account" placeholder="account"></el-input>
        </el-form-item>
        <el-form-item>
          <el-input type="password" v-model="password" placeholder="password"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button style="width: 100%" type="primary">Sign In</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
  const electron = window.require('electron');
  const {ipcRenderer, remote} = electron;

export default {
  name: "Login",
  data() {
    return {
      account: "",
      password: ""
    }
  },
  methods: {
    login() {
      this.closeWindow()
    },
    closeWindow() {
      ipcRenderer.send('close-window',remote.getCurrentWindow().id);
    },
  },
}
</script>

<style scoped>
.login-main {
  width: 100%;
  height: 100%;
  background-color: #3E3E3E;
}

.login-form {
  margin: 0 auto;
  padding-top: 15%;
  width: 230px;
}
</style>